import { MiddlewareConsumer, Module, NestModule } from '@nestjs/common'
import { WillesService } from './willes.service'
import { WillesController } from './willes.controller'
import { LoggerMiddleware } from '../middleware'
// @Global()
@Module({
  exports: [WillesService],
  controllers: [WillesController],
  providers: [
    WillesService,
    {
      provide: 'willes',
      useValue: [1, 2, 3]
    }
  ]
})
export class WillesModule implements NestModule {
  configure(consumer: MiddlewareConsumer) {
    consumer.apply(LoggerMiddleware).forRoutes(WillesController)
  }
}
